package cn.elwy.rcp.ui.table.model;

import java.io.Serializable;
import java.util.List;

import org.eclipse.jface.viewers.IBaseLabelProvider;
import org.eclipse.jface.viewers.ITreeContentProvider;

import cn.elwy.rcp.ui.table.adapter.TableConfigAdapter;
import cn.elwy.rcp.ui.table.adapter.TableEditorAdapter;
import cn.elwy.rcp.ui.table.listener.TablePaneAction;
import cn.elwy.rcp.ui.table.listener.TablePaneActionGroup;
import cn.elwy.rcp.ui.table.listener.TablePaneCheckStateListener;
import cn.elwy.rcp.ui.table.listener.TablePaneDoubleClickListener;
import cn.elwy.rcp.ui.table.listener.TablePaneDragSourceListener;
import cn.elwy.rcp.ui.table.listener.TablePaneDropTargetListener;
import cn.elwy.rcp.ui.table.listener.TablePaneKeyListener;
import cn.elwy.rcp.ui.table.listener.TablePaneMouseListener;
import cn.elwy.rcp.ui.table.listener.TablePanePropertyListener;
import cn.elwy.rcp.ui.table.listener.TablePaneSelectionListener;
import cn.elwy.rcp.ui.table.provider.TablePaneCheckStateProvider;

public class TableInfo extends TableConfig implements Serializable {

  private static final long serialVersionUID = 1L;

  public static final String TYPE_TABLE = "TABLE";
  public static final String TYPE_TABLE_TREE = "TABLE_TREE";
  public static final String TYPE_TREE = "TREE";

  private List<ButtonCompositeInfo> buttonCompositeInfoList;
  private ITreeContentProvider contentProvider;
  private IBaseLabelProvider labelProvider;
  private List<ViewerFilterInfo> viewerFilterList;
  private TablePaneCheckStateProvider checkStateProvider;
  // 监听
  private TablePaneCheckStateListener checkStateListener;
  private TablePaneDoubleClickListener doubleClickListener;
  private TablePaneDragSourceListener dragSourceListener;
  private TablePaneDropTargetListener dropTargetListener;
  private TablePaneKeyListener keyListener;
  private TablePaneMouseListener mouseListener;
  private TablePanePropertyListener propertyChangedListener;
  private TablePaneSelectionListener selectionChangedListener;
  private TablePaneActionGroup actionGroup;
  private List<TablePaneAction> actionList;

  private TableConfigAdapter tableConfigAdapter;
  private TableEditorAdapter tableEditorAdapter;

  public List<ButtonCompositeInfo> getButtonCompositeInfoList() {
    return buttonCompositeInfoList;
  }

  public void setButtonCompositeInfoList(List<ButtonCompositeInfo> buttonCompositeInfoList) {
    this.buttonCompositeInfoList = buttonCompositeInfoList;
  }

  public ITreeContentProvider getContentProvider() {
    return contentProvider;
  }

  public void setContentProvider(ITreeContentProvider contentProvider) {
    this.contentProvider = contentProvider;
  }

  public IBaseLabelProvider getLabelProvider() {
    return labelProvider;
  }

  public void setLabelProvider(IBaseLabelProvider labelProvider) {
    this.labelProvider = labelProvider;
  }

  public List<ViewerFilterInfo> getViewerFilterList() {
    return viewerFilterList;
  }

  public void setViewerFilterList(List<ViewerFilterInfo> viewerFilterList) {
    this.viewerFilterList = viewerFilterList;
  }

  public TablePaneCheckStateProvider getCheckStateProvider() {
    return checkStateProvider;
  }

  public void setCheckStateProvider(TablePaneCheckStateProvider checkStateProvider) {
    this.checkStateProvider = checkStateProvider;
  }

  public TablePaneCheckStateListener getCheckStateListener() {
    return checkStateListener;
  }

  public void setCheckStateListener(TablePaneCheckStateListener checkStateListener) {
    this.checkStateListener = checkStateListener;
  }

  public TablePaneDoubleClickListener getDoubleClickListener() {
    return doubleClickListener;
  }

  public void setDoubleClickListener(TablePaneDoubleClickListener doubleClickListener) {
    this.doubleClickListener = doubleClickListener;
  }

  public TablePaneDragSourceListener getDragSourceListener() {
    return dragSourceListener;
  }

  public void setDragSourceListener(TablePaneDragSourceListener dragSourceListener) {
    this.dragSourceListener = dragSourceListener;
  }

  public TablePaneDropTargetListener getDropTargetListener() {
    return dropTargetListener;
  }

  public void setDropTargetListener(TablePaneDropTargetListener dropTargetListener) {
    this.dropTargetListener = dropTargetListener;
  }

  public TablePaneKeyListener getKeyListener() {
    return keyListener;
  }

  public void setKeyListener(TablePaneKeyListener keyListener) {
    this.keyListener = keyListener;
  }

  public TablePaneMouseListener getMouseListener() {
    return mouseListener;
  }

  public void setMouseListener(TablePaneMouseListener mouseListener) {
    this.mouseListener = mouseListener;
  }

  public TablePanePropertyListener getPropertyChangedListener() {
    return propertyChangedListener;
  }

  public void setPropertyChangedListener(TablePanePropertyListener propertyChangedListener) {
    this.propertyChangedListener = propertyChangedListener;
  }

  public TablePaneSelectionListener getSelectionChangedListener() {
    return selectionChangedListener;
  }

  public void setSelectionChangedListener(TablePaneSelectionListener selectionChangedListener) {
    this.selectionChangedListener = selectionChangedListener;
  }

  public TablePaneActionGroup getActionGroup() {
    return actionGroup;
  }

  public void setActionGroup(TablePaneActionGroup actionGroup) {
    this.actionGroup = actionGroup;
  }

  public List<TablePaneAction> getActionList() {
    return actionList;
  }

  public void setActionList(List<TablePaneAction> actionList) {
    this.actionList = actionList;
  }

  public TableConfigAdapter getTableConfigAdapter() {
    return tableConfigAdapter;
  }

  public void setTableConfigAdapter(TableConfigAdapter tableConfigAdapter) {
    this.tableConfigAdapter = tableConfigAdapter;
  }

  public TableEditorAdapter getTableEditorAdapter() {
    return tableEditorAdapter;
  }

  public void setTableEditorAdapter(TableEditorAdapter tableEditorAdapter) {
    this.tableEditorAdapter = tableEditorAdapter;
  }

  public boolean isTable() {
    return TYPE_TABLE.equals(getType());
  }

  public boolean isTableTree() {
    return TYPE_TABLE_TREE.equals(getType());
  }

  public boolean isTree() {
    return TYPE_TREE.equals(getType());
  }

}
